#include "algraph.h"
#include "QDebug"
template <typename T>
ALGraph<T>::ALGraph(GraphKind kind) {
    this->arcnum=0;
    this->vexnum=0;
    this->kind=kind;
}
template <typename T>
bool ALGraph<T>::InsertVex(T data){
    if(this->vexnum==this->MAXVEX){
        return false;
    }
    this->vertices[this->vexnum++].data=data;
    qDebug()<<"insert data="<<data;
    return true;
}
template <typename T>
void ALGraph<T>::TraverseVex(std::function<void(VNode&)> func){

    for (int var = 0; var < this->vexnum; ++var) {
        func(this->vertices[var]);
    }
}
